<html>
<head>
     <title>Help: get_thd</title>
</head>
<body>
     <center><table><tbody>
          <tr>
             <td style="border: 1px solid rgb(170, 170, 170); padding: 5px; background-color: #ddd;">
                  <h4>get_thd</h4>Determine the seasonal and main thermocline depths
                  <br><small>Last modified: 04-Jul-2010 16:42:44</small>

          </tr>
          <tr>
             <td style="border: 0px solid rgb(170, 170, 170); padding: 5px; background-color: #ddd;">
                  <a href="http://guillaumemaze.googlecode.com/svn/trunk/matlab/codes/geophysic/get_thd.m">Download here</a>
             </td>
          </tr>
          <tr>
             <td style="border: 1px solid rgb(170, 170, 170); padding: 5px; background-color: #fff; font-size:12px;">
                  <br>% get_thd Determine the seasonal and main thermocline depths<br>%<br>% [THD THD_sc QC R D] = get_thd(ST,DPT,[PLOT],[METHOD],[SMOOTHING])<br>% <br>% Determine the seasonal and main thermocline depths from the vertical<br>% density gradient.<br>%<br>% We assume the seasonal and main thermoclines to induce two significant<br>% peaks in the vertical density gradient. <br>% Instead of selecting the depth of the two maximums in the gradient <br>% (often a useless method because of large differences in amplitude and <br>% noise around the seasonal thermocline) we adopt the following method:<br>%<br>% Notation:<br>%	OBS: Observed profile of vertical density gradient<br>%	THDsc: Seasonal thermocline depth<br>%	THD: Main thermocline depth<br>%<br>% Method:<br>% 1	- THDsc is determined as the depth of the maximum in OBS (this is almost <br>%		always the case).<br>% 2	- we create an analytical profile of reference (REF profile) for the <br>%		density gradient with a gaussian of thickness 50m, centered at THDsc<br>%		and with the observed amplitude OBS(THDsc). We compute ER0 the<br>%		standard difference between REF and OBS.<br>% 3	- we assume the main thermocline to induce a second peak in the <br>%		vertical density gradient. <br>% 4	- we create another analytical profiles as the sum of REF with a second <br>%		gaussian having an amplitude smaller than OBS(THDsc),<br>%		a larger thickness and centered at depth ZC (ANA(i) profile).<br>% 5	- we loop in step 4 for a range of ZC and we compute the standard difference <br>%		ER(ZC) between the analytical REF+ANA(ZC) and the observed OBS <br>%		vertical density gradients.<br>% 6	- the main thermocline depth is determined as the depth ZC for which<br>%		ER(ZC) is minimum.<br>% 7	- If ER(ZC) is found to be larger than ER0, the profile is thought to be <br>%		unsignificant. Therefore we loop over steps 4, 5 and 6 with a new ANA(i) <br>%		gaussian thickness until we reach a limit iteration number (QC is then 2) <br>%		or found ER(ZC) smaller than the standard error ER0 (QC will be 1).<br>% <br>%<br>% Inputs:<br>%	ST: density profile<br>%	DPT: vertical depth axis. Note that DPT(1) is at the surface<br>%		and DPT are negative defined.<br>% Optionals:<br>%	PLOT: 0 (default) or 1 <br>%		Plot a figure with relevant informations about the <br>%		determination of depths.<br>%	METHOD: method used to compute the vertical gradient<br>%		1: classic forward difference (2 points)<br>%		2 (default): classic centered difference (3 points)<br>%		3: classic centered difference (5 points)<br>%	SMOOTHING: 1 (default) or 0<br>%		This parameter determines if we should apply a little bit of<br>%		smoothing on the density profile before computing the vertical<br>%		gradient.<br>%	<br>% Outputs:<br>%	THD: Main thermocline depth.<br>%	THD_sc: Seasonal thermocline depth.<br>%	QC: quality flag of the estimate<br>%		1: reliable<br>%		2: why not, but weired, need a visual check<br>%<br>%	R: Standard error between all analytical and the real density profils<br>%	D: Depth range used to determine depth.<br>%<br>% Created: 2009-11-23.<br>% All rights reserved.
             </td>
          </tr>
          <tr>
             <td style="border: 1px solid rgb(170, 170, 170); padding: 5px; background-color: #ddd; font-size:12px;">
                  Last update: 2011 March 04, 17:46<br>
                  Created by Guillaume Maze<br>
                  More informations at: <a href="http://codes.guillaumemaze.org/matlab">codes.guillaumemaze.org/matlab</a><br>
             </td>
          </tr>
     </tbody></table></center>
</body>
</html>
